﻿using LtccApi.Models;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LtccApi.Controllers
{
    /// <summary>
    /// 卡车轮胎列表全部品牌下拉选项数据
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class TruckTireBrandFirstLetterController : Controller
    {
        private LtccContext mLtccContext;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="ltccContext"></param>
        public TruckTireBrandFirstLetterController(LtccContext ltccContext)
        {
            mLtccContext = ltccContext;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult List()
        {
            List<TruckBrand> listData = mLtccContext.TruckBrands.ToList();
            TruckBrand brand = new TruckBrand();
            brand.TireName = "全部";
            listData.Insert(0, brand);
            return Ok(listData);
        }
    }
}
